home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
pas_0593.zip
/
NORESET.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-05-30
|
3KB
|
134 lines
{─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
Msg : 273 of 319
From : Marc Van Leeuwen 2:292/405.0 26 Apr 93 16:52
To : All
Subj : Intercepting [Ctrl][Alt][Del]
────────────────────────────────────────────────────────────────────────────────
* Forwarded from "PASCAL.CM"
* Originally by Marc Van Leeuwen
* Originally to ALL
* Originally dated 26 Apr 1993, 16:52
After a lot of people all over the world, have asked me for a routine,
intercepting the [Ctrl][Alt][Del], I decided to post you all a routine which
will do just that.
It's larger then it has to be, but that is for the following reasons:
a) it is has included a way for intercepting [Ctrl][Alt][Del] in a program AND
as a TSR.
b) it is also made for BP7-Protected mode, aswel as for TP 5/6/7
As BP-7-protected mode can't make any good TSR's, that function has been
disabled.
For Frontdoor users, if you press [Alt][V] now, you can post this message to a
file and only need to put a '{' at the beginning of the file, to be able to
compile this message!
Here we go ...
---------------------------------------------------------}
PROGRAM NoReset;
{(c)1993 by Marc van Leeuwen. Fido 2:292/405 == CompuMed 50:3214/105 }
{ ┌──────────┐ Use it as you want, it works for me, }
{ │PD-Program│ but it might not work for you, so use }
{ └──────────┘ it as is, and modify the errors yourself!}
Uses Crt,Dos
{$IFDEF DPMI}
,WinAPI
{$ENDIF};
{$F+}
{ $ DEFINE TSR}
{^^^^^^^^^^^^^ Take away the 2 spases to make a tsr program that intercepts}
{ the reset. it WON'T work in protected-mode! }
{$IFDEF TSR}
{$IFDEF DPMI}
{$M 1024}
{$ELSE}
{$M 1024,0,0}
{$ENDIF}
{$ENDIF}
var
Seg0000 : word;
PROCEDURE Init_Seg0000;
const
Seg = $0000;
Ofs = 0;
begin
{$IFDEF DPMI}
Seg0000 := AllocSelector(0);
SetSelectorBase(Seg0000, Seg*Longint(16)+Ofs);
SetSelectorLimit(Seg0000, $FFFF);
{$ELSE}
seg0000 := seg;
{$ENDIF}
end;
Const
CtrlCharacter =$4;
AltCharacter = $8;
DelCharacter = 83;
VAR OudInterupt : Procedure;
Procedure ResetIntercept; Interrupt;
BEGIN
IF (Port[$60] = DelCharacter) AND
((Mem[Seg0000:$0417] AND CtrlCharacter) = CtrlCharacter) AND
((Mem[Seg0000:$0417] AND AltCharacter) = AltCharacter) THEN
BEGIN
Inline($FA);
Port[$20]:=$20;
Inline($FB);
END
ELSE
BEGIN
Inline($9C);
OudInterupt;
END;
END;
Procedure SwitchResetOff;
BEGIN
GetIntVec($09,@OudInterupt);
SetIntVec($09,@ResetIntercept);
END;
Procedure SwitchResetOn;
BEGIN
SetIntVec($09,@OudInterupt);
END;
BEGIN
{$IFDEF TSR}
{$IFDEF DPMI}
( => TSR-programs can`t be made for DPMI-mode programs!!! <= )
{$ENDIF}
SwitchResetOff;
Keep(0); {Start de TSR}
{$ELSE}
Init_Seg0000;
SwitchResetOff;
{Vervolgens Uw programma, zoals...}
Writeln('Ctrl-Alt-Del won''t work now!');
Repeat Until ReadKey = #27; {Escape stopt het programma}
Writeln('Ctrl-Alt-Del will be switched on.');
{En dan weer eindigen met}
SwitchResetOn;
{$ENDIF}
END.
{---------------------------------------------------------
Hope some of you might find it of any use.
This program is freqable and dl-able from me, as NoResetE.ARJ. The Dutch
version of this program is called NoReset.ARJ.}